<template>
	<view :class="vi_pageSize">
		<vi-notify :top="topfix" ref="vi_notify"></vi-notify>
		<module-loading ref="vi_loading" :loading="vi_loading" :loadingMask="vi_loadingMask"></module-loading>
		<vi-headbar goback>
			<view slot="right">
				响应式
				<text class="response">开启</text>
				<text class="noresponse color-warning">关闭</text>
			</view>
			{{vi_pageTitle}}
		</vi-headbar>
		<view class="docTable">
			<view class="th">
				<view>属性名</view>
				<view>类型</view>
				<view>默认值</view>
				<view>描述</view>
			</view>
			<view class="tr">
				<view>type</view>
				<view>String</view>
				<view>primary</view>
				<view>颜色主题</view>
			</view>
			<view class="tr">
				<view>color</view>
				<view>String</view>
				<view>无</view>
				<view>自定义主题色</view>
			</view>
			<view class="tr">
				<view>textColor</view>
				<view>String</view>
				<view>无</view>
				<view>固定文字色</view>
			</view>
			<view class="tr">
				<view>radius</view>
				<view>String, Number</view>
				<view>circle</view>
				<view>搜索按钮、搜索框圆角</view>
			</view>
			<view class="tr">
				<view>size</view>
				<view>String</view>
				<view>md</view>
				<view>预定义尺寸样式，可选lg、md、sm</view>
			</view>
			<view class="tr">
				<view>buttonWidth</view>
				<view>Number</view>
				<view>无</view>
				<view>按钮宽，固定单位em</view>
			</view>
			<view class="tr">
				<view>height</view>
				<view>Number</view>
				<view>2</view>
				<view>搜索条高度，输入框、按钮自动撑满</view>
			</view>
			<view class="tr">
				<view>bgColor</view>
				<view>String</view>
				<view>#eee</view>
				<view>输入框背景色，非镂空时有效</view>
			</view>
			<view class="tr">
				<view>plain</view>
				<view>Boolean</view>
				<view>false</view>
				<view>输入框镂空</view>
			</view>
			<view class="tr">
				<view>placeholder</view>
				<view>String</view>
				<view>	</view>
				<view>输入框空值提示，默认：请输入关键词</view>
			</view>
			<view class="tr">
				<view>value</view>
				<view>String</view>
				<view>无</view>
				<view>初始关键词</view>
			</view>
			<view class="tr extra">
				<view class="body">
					<view>buttonStyle</view>
					<view>String</view>
					<view>iconRight</view>
					<view>
						搜索条样式
					</view>
				</view>
				<view class="appendix">
					<view>iconLeft内部左侧图标，iconRight内部右侧图标</view>
					<view>outsideLeft外部左侧按钮，outsideRight外部右侧按钮</view>
					<view>insideLeft内部左侧衔接按钮，insideRight内部右侧衔接按钮</view>
					<view>active动态搜索(注意性能问题)</view>
				</view>
			</view>
			<view class="tr extra">
				<view class="body">
					<view>icon</view>
					<view>Object</view>
					<view></view>
					<view>iconfont图标数据覆盖</view>
				</view>
				<view class="appendix">
					格式：{key:"图标名"}
					<view>search：icon-search 搜索，icon模式有效</view>
				</view>
			</view>
			<view class="tr extra">
				<view class="body">
					<view>text</view>
					<view>Object</view>
					<view></view>
					<view>内部文字数据覆盖</view>
				</view>
				<view class="appendix">
					格式：{key:"文字"}
					<view>search：搜索　搜索按钮</view>
					<view>plcEnterKeyword：请输入关键词　默认输入框空值提示</view>
				</view>
			</view>
			<view class="tr">
				<view>initSearch</view>
				<view>Boolean</view>
				<view>true</view>
				<view>初始自动搜索，有关键词时</view>
			</view>
			<view class="tr">
				<view>disabled</view>
				<view>Boolean</view>
				<view>false</view>
				<view>禁用</view>
			</view>
			<view class="tr">
				<view>readOnly</view>
				<view>Boolean</view>
				<view>false</view>
				<view>只读</view>
			</view>
			<view class="tr">
				<view>@input</view>
				<view>事件</view>
				<view>	</view>
				<view>输入事件，提交当前关键词，用于model</view>
			</view>
			<view class="tr">
				<view>@search</view>
				<view>事件</view>
				<view>	</view>
				<view>执行搜索事件，返回当前关键词</view>
			</view>
		</view>
		
		
		<view class="p-sm">
			<view class="py-sm">
				基本使用：{{'&lt;vi-searchbar value="关键词">按钮文字或带图标&lt;/vi-searchbar>'}}
			</view>
			<view class="py-sm">
				<vi-searchbar></vi-searchbar>
				<view>默认 buttonStyle = iconRight</view>
			</view>
			<view class="py-sm">
				<vi-searchbar buttonStyle="iconLeft" @search="doSearch"></vi-searchbar>
				<view>buttonStyle = iconLeft</view>
			</view>
			<view class="py-sm">
				<vi-searchbar buttonStyle="outsideLeft" @search="doSearch"></vi-searchbar>
				<view>buttonStyle = outsideLeft</view>
			</view>
			<view class="py-sm">
				<vi-searchbar buttonStyle="outsideRight" @search="doSearch"></vi-searchbar>
				<view>buttonStyle = outsideRight</view>
			</view>
			<view class="py-sm">
				<vi-searchbar buttonStyle="insideLeft" @search="doSearch"></vi-searchbar>
				<view>buttonStyle = insideLeft</view>
			</view>
			<view class="py-sm">
				<vi-searchbar buttonStyle="insideRight" @search="doSearch"></vi-searchbar>
				<view>buttonStyle = insideRight</view>
			</view>
			<view class="py-sm">
				<vi-searchbar buttonStyle="active" @search="doSearch"></vi-searchbar>
				<view>buttonStyle = active</view>
			</view>
			<view class="py-sm">
				<vi-searchbar buttonStyle="outsideLeft" plain @search="doSearch"></vi-searchbar>
			</view>
			<view class="py-sm">
				<vi-searchbar buttonStyle="outsideRight" plain @search="doSearch"></vi-searchbar>
			</view>
			<view class="py-sm">
				<vi-searchbar buttonStyle="insideLeft" plain @search="doSearch"></vi-searchbar>
			</view>
			<view class="py-sm">
				<vi-searchbar buttonStyle="insideRight" plain @search="doSearch"></vi-searchbar>
			</view>
			<view class="py-sm">
				<vi-searchbar buttonStyle="iconRight" plain @search="doSearch"></vi-searchbar>
				<view>plain = true</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		methods: {
			doSearch(e){
				console.log("关键词", e);
			}
		}
	}
</script>

<style lang="scss" scoped>
.vi_button .vi_icon{
	margin-right: 0.5em;
}
.vi_button /deep/ .vi_hover{
	opacity: 0.8;
}
</style>
